<?php
    $cli = new swoole_client(SWOOLE_SOCK_TCP);
    if(!$cli->connect("127.0.0.1",9501)){
        die("connect tcp server failed");
        exit;
    }

    fwrite(STDOUT,"Please Input The Message :");
    $msg = fgets(STDIN);
    $cli->send($msg);
    $res = $cli->recv();
    echo $res."\n";